[Chapter 18] 18.3 Obtain the Source
Author: Bryan Costales & Eric Allman
Date: 1999-01-06T18:42:18Z

#

| Chapter 18 Compile and Install sendmail |

## 18.3 Obtain the Source

V8 sendmail is available from:

> ftp://ftp.sendmail.org/ucb/sendmail

When you cd into this directory, a banner is displayed that describes the latest release and available patches. You may choose between two forms of compressed tar(1) distributions. Those that end in .Z are compressed with UNIX compress(1); those that end in .gz are compressed with GNU gzip(1). The latter is the preferred form because the file is smaller and quicker to transfer.

In addition to the two forms of distribution, each release has associated with it a PGP signature file. It is a signature of the uncompressed file, so you need to uncompress the tar(1) file before verifying it. To verify a pre-V8.6 distribution, get Eric Allman's public key by sending email to pgp-public-keys@keys.pgp.net with the following subject line:

>     Subject: MGET Allman

Eric Allman's public key will be mailed back to you a few minutes later. [2] Save that returned email to a file, for example /tmp/eric.asc, and add that key to your public "keyring" with the command:

> [2] As an alternative, you can run the command

> >     finger -l eric@finger.sendmail.org > /tmp/eric.asc

> and use that PGP information in place of the email information. They are equivalent.

>     pgp -ka /tmp/eric.asc

For V8.6 and above, you download a special signing key from www.sendmail.org, instead of Eric's key. The fingerprint for the signing key is:

>     CA AE F2 94 3B 1D 41 3C  94 7B 72 5F AE 0B 6A 11

The fingerprint for Eric's key is:

>     C0 28 E6 7B 13 5B 29 02 6F 7E 43 3A 48 4F 45 29

then execute:

>     pgp signature file here

If the uncompressed tar file is good, pgp(1) will report the following or some variation on it:

>     Good signature from user "Eric P. Allman <eric@CS.Berkeley.EDU>".

A few things can go wrong here, causing the verification to fail:

- Signature and tar(1) files must match each other's versions. Transfer them again, this time with matching versions.

- When transferring the files with ftp(1), you must be sure to use binary mode. Transfer them again, this time with the correct mode.

- A presumed mirror FTP site might not be as official as you expect. If a secondary distribution fails to verify, get the official distributions from the official site shown above.

- The official distribution may appear bad. If it fails to verify, first check that your copy of pgp was correctly installed, then check that your network connection is clean and that it has not been compromised. If all else fails (including getting the distribution anew as above), describe your problem to the folks at sendmail@sendmail.org.

If your copy of the sendmail distribution fails to verify, don't use it!

### 18.3.1 What's Where in the Source

V8.8.6 sendmail unpacks by creating a directory, then unpacking into that directory. The directory name is the same as the compressed file name but with the first dot a dash instead:

>     % zcat sendmail.8.8.6.tar.Z | tar xvf -
>     x sendmail-8.8.6/FAQ, 32312 bytes, 64 tape blocks
>     x sendmail-8.8.6/KNOWNBUGS, 4714 bytes, 10 tape blocks
>     x sendmail-8.8.6/Makefile, 1215 bytes, 3 tape blocks
>     ... and so on

Inside the newly created directory you will find the full sendmail distribution:

>     % cd sendmail-8.8.6
>     % ls
>     FAQ             RELEASE_NOTES   mail.local      rmail
>     KNOWNBUGS       cf              mailstats       smrsh
>     Makefile        contrib         makemap         src
>     READ_ME         doc             praliases       test

The READ_ME and RELEASE_NOTES files provide the most up-to-date information about changes, new features, and bug fixes. Read the documents in the doc directory. Also note that there are important comments in the src/READ_ME and cf/README files.

You will find almost everything you need to build sendmail in the src subdirectory. There are a few exceptions that we will cover in this chapter.

### 18.3.2 The makesendmail Script

The first step in compiling sendmail is to establish an object directory and a Makefile that is appropriate to your machine architecture and operating system. You do this by running the makesendmail script in the src directory:

>     % cd src
>     % ./makesendmail -n
>     Configuration: os=SunOS, rel=4.1.4, rbase=4, arch=sun4, sfx=
>     Creating obj.SunOS.4.1.4.sun4 using Makefile.SunOS
>     Making dependencies in obj.SunOS.4.1.4.sun4
>      many more lines here
>     %

Here, makesendmail found that ours was a `sun4` machine, running the SunOS 4.1.4 release of UNIX. It created the working directory obj.SunOS.4.1.4.sun4, set up symbolic links to all the source files in that directory, and copied a Makefile there. The `-n` switch [3] prevents make from actually building sendmail. Note that, except for the `-m` switch, all command-line arguments following the makesendmail are passed to make(1) as its own command-line arguments.

> [3] As an alternative, the `-m` command-line switch causes makesendmail to print the name of your Makefile without actually creating the obj.* subdirectory.

The makesendmail script knows how to build sendmail on many versions of UNIX, including offshoots such as OSF/1 and NextStep. In the unlikely case that your operating system is not supported, you will see an error message instead of the above output:

>     Configuration: os=EX/Unix, rel=1, rbase=1, arch=sun4, sfx=
>     Cannot determine how to support sun4.EX/Unix.1

Here, an experimental version of UNIX called EX/Unix on a sun4 computer was unrecognized by the makesendmail script. Porting sendmail to new operating systems is really beyond the scope of this book. But we offer a complete listing of `#define` macros in Section 18.8 at the end of this chapter, and that, as well as much of the tuning that we discuss here, can also be germane to porting.

### 18.3.3 What to Tune

Before you let makesendmail run to completion, you may need to tune three of sendmail's files for your site:

Makefile/`*`

  Specifies where to install the binaries and how to compile them. Makefile is normally the only file you will have to modify if you are running an already supported operating system

conf.h

  Specifies maximum sizes and other properties that are tunable for porting:

conf.c

  Specifies C language code to support specific and unusual needs. Tunable items in conf.c include the checkcompat() routine (see Chapter 20, The checkcompat() Cookbook) and default header behavior (see Section 35.5, "Header Behavior in conf.c").

18.2 Vendor Versus Compiling |  | 18.4 Tuning Makefile